<!--title-->
<div class="mnav1">
	<div class="m_nav">
		<div class="nav_left">
			<em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
		</div>
	</div>
</div>

<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<br />
<?php endif;?>
<div align="center">
<?php if(2 == $this->id_type):?>
<?php if($this->data['self']['product_id']):?>
<input type="button" value="返回<?=$this->data['self']['parent_name']?>" onclick="window.location.href='/clients/sku-details/product_id/<?=$this->data['self']['product_id']?>'" />&nbsp;&nbsp;&nbsp;&nbsp;
<?php else:?>
<input type="button" value="返回<?=$this->data['self']['parent_name']?>" onclick="window.location.href='/clients/sku-details/sku_id/<?=$this->data['self']['parent_sku_id']?>'" />&nbsp;&nbsp;&nbsp;&nbsp;
<?php endif;?>
<?php endif;?>
<input type="button" value="返回产品首页" onclick="window.location.href='/clients/sku-mgt'" />
</div>
<br>
<form action="/clients/sku-tree-submit" method="post" name="form1">
<table style="width: 1000px" align='center'>
  <tr>
	<th style="width: 500px">路径</th>
	<th>分类名</th>
    <th>单价(元)</th>
    <th>单位</th>
    <th>状态</th>
  </tr>
  <?php foreach($this->data['data'] as $sku_id => $sku_info):?>
  <tr>
	<td align="left">&nbsp;&nbsp;<a href="/clients/sku-details/sku_id/<?=$sku_id?>"><?=$sku_info['sku_name']?></a></td>
    <td><input type="text" name="sku_name_<?=$sku_id?>" id="sku_name_<?=$sku_id?>" value="<?=$sku_info['sku_name']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_price_<?=$sku_id?>" id="unit_price_<?=$sku_id?>" value="<?=$sku_info['unit_price']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_name_<?=$sku_id?>" id="unit_name_<?=$sku_id?>" value="<?=$sku_info['unit_name']?>" style="width: 50px" /></td>
    <td><select name="status_<?=$sku_id?>" id="status_<?=$sku_id?>">
			<option value="1" <?php if($sku_info['status']){echo "selected='selected'";}?>>正常</option>
			<option value="0" <?php if(!$sku_info['status']){echo "selected='selected'";}?>>下架</option>
		</select>
	</td>
  </tr>
  <?php if(isset($this->data['relation'][$sku_id])):?>
  <?php foreach($this->data['relation'][$sku_id] as $kid => $kinfo):?>
  <tr>
	<td align="left">&nbsp;&nbsp;<a href="/clients/sku-details/sku_id/<?=$sku_id?>"><?=$sku_info['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid?>"><?=$kinfo['sku_name']?></a></td>
    <td><input type="text" name="sku_name_<?=$kid?>" id="sku_name_<?=$kid?>" value="<?=$kinfo['sku_name']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_price_<?=$kid?>" id="unit_price_<?=$kid?>" value="<?=$kinfo['unit_price']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_name_<?=$kid?>" id="unit_name_<?=$kid?>" value="<?=$kinfo['unit_name']?>" style="width: 50px" /></td>
    <td><select name="status_<?=$kid?>" id="status_<?=$kid?>">
			<option value="1" <?php if($kinfo['status']){echo "selected='selected'";}?>>正常</option>
			<option value="0" <?php if(!$kinfo['status']){echo "selected='selected'";}?>>下架</option>
		</select>
	</td>
  </tr>
  <?php if(isset($this->data['relation'][$kid])):?>
  <?php foreach($this->data['relation'][$kid] as $kid2 => $kinfo2):?>
  <tr>
	<td align="left">&nbsp;&nbsp;<a href="/clients/sku-details/sku_id/<?=$sku_id?>"><?=$sku_info['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid?>"><?=$kinfo['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid2?>"><?=$kinfo2['sku_name']?></a></td>
    <td><input type="text" name="sku_name_<?=$kid2?>" id="sku_name_<?=$kid2?>" value="<?=$kinfo2['sku_name']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_price_<?=$kid2?>" id="unit_price_<?=$kid2?>" value="<?=$kinfo2['unit_price']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_name_<?=$kid2?>" id="unit_name_<?=$kid2?>" value="<?=$kinfo2['unit_name']?>" style="width: 50px" /></td>
    <td><select name="status_<?=$kid2?>" id="status_<?=$kid2?>">
			<option value="1" <?php if($kinfo2['status']){echo "selected='selected'";}?>>正常</option>
			<option value="0" <?php if(!$kinfo2['status']){echo "selected='selected'";}?>>下架</option>
		</select>
	</td>
  </tr>
  <?php if(isset($this->data['relation'][$kid2])):?>
  <?php foreach($this->data['relation'][$kid2] as $kid3 => $kinfo3):?>
  <tr>
	<td align="left">&nbsp;&nbsp;<a href="/clients/sku-details/sku_id/<?=$sku_id?>"><?=$sku_info['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid?>"><?=$kinfo['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid2?>"><?=$kinfo2['sku_name']?> > <a href="/clients/sku-details/sku_id/<?=$kid3?>"><?=$kinfo3['sku_name']?></a></td>
    <td><input type="text" name="sku_name_<?=$kid3?>" id="sku_name_<?=$kid3?>" value="<?=$kinfo3['sku_name']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_price_<?=$kid3?>" id="unit_price_<?=$kid3?>" value="<?=$kinfo3['unit_price']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_name_<?=$kid3?>" id="unit_name_<?=$kid3?>" value="<?=$kinfo3['unit_name']?>" style="width: 50px" /></td>
    <td><select name="status_<?=$kid3?>" id="status_<?=$kid3?>">
			<option value="1" <?php if($kinfo3['status']){echo "selected='selected'";}?>>正常</option>
			<option value="0" <?php if(!$kinfo3['status']){echo "selected='selected'";}?>>下架</option>
		</select>
	</td>
  </tr>
  <?php if(isset($this->data['relation'][$kid3])):?>
  <?php foreach($this->data['relation'][$kid3] as $kid4 => $kinfo4):?>
  <tr>
	<td align="left">&nbsp;&nbsp;<a href="/clients/sku-details/sku_id/<?=$sku_id?>"><?=$sku_info['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid?>"><?=$kinfo['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid2?>"><?=$kinfo2['sku_name']?> > <a href="/clients/sku-details/sku_id/<?=$kid3?>"><?=$kinfo3['sku_name']?></a> > <a href="/clients/sku-details/sku_id/<?=$kid4?>"><?=$kinfo4['sku_name']?></a></td>
    <td><input type="text" name="sku_name_<?=$kid4?>" id="sku_name_<?=$kid4?>" value="<?=$kinfo4['sku_name']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_price_<?=$kid4?>" id="unit_price_<?=$kid4?>" value="<?=$kinfo4['unit_price']?>" style="width: 100px" /></td>
	<td><input type="text" name="unit_name_<?=$kid4?>" id="unit_name_<?=$kid4?>" value="<?=$kinfo4['unit_name']?>" style="width: 50px" /></td>
    <td><select name="status_<?=$kid4?>" id="status_<?=$kid4?>">
			<option value="1" <?php if($kinfo4['status']){echo "selected='selected'";}?>>正常</option>
			<option value="0" <?php if(!$kinfo4['status']){echo "selected='selected'";}?>>下架</option>
		</select>
	</td>
  </tr>
  <?php endforeach;?>
  <?php endif;?>
  <?php endforeach;?>
  <?php endif;?>
  <?php endforeach;?>
  <?php endif;?>
  <?php endforeach;?>
  <?php endif;?>
  <?php endforeach;?>
</table>
<div align="center">
<br><br>
<input type="hidden" name="sku_id" value="<?=$this->sku_id?>" />
<input type="button" class="buttonlong" value="更 新" onclick="submitform();return false;" />
<br /><br /><br /><br />
</div>
</form>

<script>
function num(th){
	th.value = th.value.replace(/[^\d\.]*$/g, '');
}

function submitform() 
{
	form1.submit();
}
</script>